import React from 'react'
import {NavLink,Route} from 'react-router-dom';
import OrdersIndex from "./orders";
import PaidIndex from "./paid";
import HarvestedIndex from "./harvested";
import EvaluatedIndex from "./evaluated";
import indexs from "../../../assets/css/user/orders/indexs.module.css";

export default class IndexComponent extends React.Component {
    goBack(){
        this.props.history.push('/')
    }
    render() {
        return(
            <div style={{background:'white'}}>
                <div className={indexs.boxIndexs}>
                    <div>
                        <img src={require('../../../assets/images/home/goods/back.png')} alt="" onClick={this.goBack.bind(this)}/>
                        <span>全部订单</span>
                    </div>
                    <ul className={indexs.NavLink}>
                        <li><NavLink activeClassName={indexs.active} to={"/user/order/orders?status=all"}>全部订单</NavLink></li>
                        <li><NavLink activeClassName={indexs.active} to={"/user/order/paid?status=0"}>待付款</NavLink></li>
                        <li><NavLink activeClassName={indexs.active} to={"/user/order/harvested?status=1"}>待收获</NavLink></li>
                        <li><NavLink activeClassName={indexs.active} to={"/user/order/evaluated?status=2"}>待评价</NavLink></li>
                    </ul>
                </div>
                <div>
                    <Route exact path="/user/order/orders" component={OrdersIndex}></Route>
                    <Route path="/user/order/paid" component={PaidIndex}></Route>
                    <Route path="/user/order/harvested" component={HarvestedIndex}></Route>
                    <Route path="/user/order/evaluated" component={EvaluatedIndex}></Route>
                </div>
            </div>
        )
    }
}